package view;

import model.DataSource;
import controller.ActionLis;

import javax.swing.*;
import java.awt.*;

public class StopGameJPanel extends JPanel {
    public JButton yesJButton;
    public JButton  noJButton;
    public JLabel jLabel;
    public ActionLis actionLis=new ActionLis();
    public StopGameJPanel(){
        setLayout(null);
        Font font = new Font("黑体", Font.BOLD, 40);
        yesJButton = new JButton("确定");
        yesJButton.setFont(font);
        yesJButton.setActionCommand("确定");
        yesJButton.addActionListener(actionLis);
        yesJButton.setBounds(400,460,200,50);

        noJButton = new JButton("取消");
        noJButton.setFont(font);
        noJButton.setActionCommand("取消");
        noJButton.addActionListener(actionLis);
        noJButton.setBounds(630,460,200,50);

        jLabel = new JLabel("是否要退出？");
        jLabel.setFont(font);
        jLabel.setBounds(500,200,300,200);
        add(yesJButton);
        add(noJButton);
        add(jLabel);
    }
    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(DataSource.gameBackGround,0,0,1200,800,null);
    }
}